/*************************************
 * Created by WebStorm
 * Author : 菲尔敦
 * QQ邮箱：2891044172@qq.com  手机号：15981761402
 * Created Time :2024/2/5 18:47
 Desc :
 **************************************/
import {Config} from '@/config';

export function checkStatus(code: number, msg: string='') {
    const $message = window['$message'];
    switch (code) {
        case 500:
            $message.error('服务器错误,请联系管理员!');
            break;
        case 600:
            const LoginPath = Config.BASE_LOGIN;
            $message.error(msg, {
                duration: 3000,
                onLeave() {
                    window.location.href = LoginPath;
                }
            });
            break;
        default:
            $message.error(msg);
    }
}